﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace HCMS.Entities.OAuth2
{
    /// <summary>
    /// OAuth 2.0 AccessToken
    /// </summary>
    [Table("oauth2_access_token")]
    public class OAuth2AccessToken : Entity<int>
    {
        /// <summary>
        /// 创建 时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 应用 Id
        /// </summary>
        [Column("app_id")]
        public int AppId { get; set; }

        /// <summary>
        /// Token 值
        /// </summary>
        [Column("token")]
        public string Token { get; set; } = "";

        /// <summary>
        /// 凭证有效时间，单位：秒
        /// </summary>
        /// <remarks>
        /// 例如：有效期：30天，这里就是30天对应的秒数
        /// </remarks>
        [Column("expires_in")]
        public int ExpiresIn { get; set; }
    }
}
